package StudyCode.summary.Basic.numberformat;

import java.text.DecimalFormat;
import java.text.ParsePosition;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ParsingNumbers {
	public static void main(String[] args) {
		String str = "Hello4,123.123";
		String pattern = "#,###.###";
		DecimalFormat formatter = new DecimalFormat();
		formatter.applyPattern(pattern);
		ParsePosition pp = new ParsePosition(5);
		Number numberObject = formatter.parse(str, pp);
		System.out.println(str + " 解析后的数字是:" + numberObject.doubleValue());
	}
}
